package cn.itcast.hotel.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @Author: 生如夏花
 * @Date: 2022/3/9 10:03
 */
@Component
public class EsConfig {
    @Bean
    public RestHighLevelClient client(){
        RestHighLevelClient restHighLevelClient = new RestHighLevelClient (RestClient.builder (
               HttpHost.create ("http://47.108.68.42:9200")
        ));
        return restHighLevelClient;
    }
}
